package com.wn.config;

import com.wn.interceptor.MyInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

//@Configuration
public class InterceptorConfig implements WebMvcConfigurer {

//    @Override
//    public void addInterceptors(InterceptorRegistry registry) {
//        //注册 Interceptor 拦截器
//        InterceptorRegistration registration = registry.addInterceptor(new MyInterceptor());
//
//        registration.addPathPatterns("/**");  // 拦截器所有的请求
//        registration.excludePathPatterns( //放行 静态资源
//                "/login",
//                "/",
//                "/**/*.html",
//                "/**/*.js",
//                "/**/*.css"
//        );
//    }
}
